<?php
/**
 * Created by PhpStorm.
 * User: weijie
 * Date: 2016/10/30
 * Time: 上午8:06
 */
$uri = "http://unios.cc:80/console/api/assignments/99d80b1f-6d96-4592-97ea-c34ff13723a0/invocations";
// 参数数组
$data = array (
    'body' => '{
                  "eventDate": "2016-08-04T16:02:40.723+0000",
                  "updateState": false,
                  "metadata": {},
                  "initiator": "REST",
                  "initiatorId": "admin",
                  "target": "Assignment",
                  "targetId": "",
                  "commandToken": "4deedba0-adde-4057-9163-76d588858d89",
                  "parameterValues": {
                        "act": "0",
                        "pin": "12"
                      },
                  "status": "Pending"
                }',
    'token' => '99d80b1f-6d96-4592-97ea-c34ff13723a0'
// 'password' => 'password'
);

$ch = curl_init ();
// print_r($ch);
curl_setopt ( $ch, CURLOPT_URL, $uri );
curl_setopt ( $ch, CURLOPT_POST, 1 );
curl_setopt ( $ch, CURLOPT_HEADER, 0 );
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $data );
$return = curl_exec ( $ch );
curl_close ( $ch );

print_r($return);
